#! /bin/sh

# chkconfig: 2345 20 80
# description: Start and stop InfiniBand ATS daemon

### BEGIN INIT INFO
# Provides:          ib-his
# Required-Start:    
# Should-Start:
# Required-Stop:
# Should-Stop:
# Default-Start:     3 5
# Default-Stop:
# Short-Description: Starts and stops his
#
### END INIT INFO


case "$1" in
        start)
		/usr/voltaire/his
                ;;
        stop)
		if [ ! -z "$(pidof his)" ] ; then
			killall -9 his
		fi
                ;;
        status)
		if [ ! -z "$(pidof his)" ] ; then
			echo his
		fi
                ;;
        restart)
		if [ ! -z" $(pidof his)" ] ; then
			killall -9 his
		fi
		/usr/voltaire/his
                ;;
        *)
                echo "Usage: $0 {start|stop|restart|status}"
                exit 1
                ;;
esac

exit 0

